// PubDefine
package etc

const Debug = true
const (
	M = 1048576 //单位兆
)
const (
	ConfigName         = "swim.conf"
	DbName             = "swim"
	LanguageName       = "lang.conf"
	OnlineServiceUsers = "OnlineServiceUsers"
)

const (
	S_NO_SESSION        = 0
	S_HAS_SESSION       = 1
	S_LOG_OUT_NORMAL    = 1 //正常关闭
	S_LOG_OUT_EXCEPTION = 0 //异常关闭
	S_CTYPE_WEB         = 0 //web客户向服务人员会话
	S_CTYPE_SCLIENT     = 1 //服务人员向WEB会话
	S_CTYPE_S2S         = 2 //服务人员之间的聊天会话
)
const (
	S_LIFESPAN          = 300  //会话生存周期为300秒
	S_QUERY_MSG_TIME    = 20   //查询消息时间
	S_MSG_LIFE_CYCLE    = 300  //一条消息生存周期
	S_GC_SESSION_TIME   = 30   //清理会话周期(秒)
	S_REFRESH_USER_TIME = 30   //刷新在线用户时间
	S_MIN_SEND_MSG_TIME = 1    //最快说话速度为1秒
	S_MAX_MSG_POOL_SIZE = 1024 //每个会话最大缓存条数
)
const (
	S_SAY_C2S = 1 //cid到sid
	S_SAY_S2C = 2 //sid到cid
)
const (
	MAX_USER_LOGIN = 5    //一小时内最多登录次数
	MAX_USER_NAME  = 32   //帐户名最大长度
	MAX_PASSWORD   = 16   //最大密码长度
	MAX_SID_LEN    = 64   //临时ID的长度
	MAX_MSG_LEN    = 1024 //每条消息的最大长度
)
